(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/stopView.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, 'a739dqehNdBbIZsWqxYBrrA', 'stopView', __filename);
// Script/stopView.js

"use strict";

var _backgrould = require("./backgrould");

var _backgrould2 = _interopRequireDefault(_backgrould);

var _mouse = require("./mouse");

var _mouse2 = _interopRequireDefault(_mouse);

var _allVariable = require("./allVariable");

var _allVariable2 = _interopRequireDefault(_allVariable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

cc.Class({
    extends: cc.Component,

    properties: {

        continueBtn: cc.Button,
        againGameBtn: cc.Button,
        backMapBtn: cc.Button,
        backgrouldJs: _backgrould2.default,
        voiceBtn: cc.Button,
        selectstate: cc.Boolean,
        mouse: _mouse2.default

    },

    voiceChange: function voiceChange() {

        this.selectstate = !this.selectstate;
        _allVariable2.default.SourceChange = this.selectstate;
        if (this.selectstate == true) {
            var that = this;
            console.log("声音关");

            cc.loader.loadRes("syssoundoff2", cc.SpriteFrame, function (err, spriteFrame) {
                that.node.getChildByName('voiceBtn').getComponent(cc.Sprite).spriteFrame = spriteFrame;
            });
        } else {
            var _that = this;
            console.log("声音开");
            cc.loader.loadRes("syssoundon2", cc.SpriteFrame, function (err, spriteFrame) {
                _that.node.getChildByName('voiceBtn').getComponent(cc.Sprite).spriteFrame = spriteFrame;
            });
        }
    },

    continueGameClick: function continueGameClick() {

        console.log("继续游戏");
        this.node.active = false;
        this.backgrouldJs.startGame();
    },

    againGameClick: function againGameClick() {
        console.log("重新开始游戏");
        cc.director.loadScene("GameSence");
    },

    backMapClick: function backMapClick() {

        console.log("返回地图");
        cc.director.loadScene("StartGame");
    },

    onLoad: function onLoad() {

        this.selectstate = _allVariable2.default.SourceChange;
        console.log("全局声音开关", _allVariable2.default.SourceChange);
        if (this.selectstate == true) {
            var that = this;
            console.log("声音关");

            cc.loader.loadRes("syssoundoff2", cc.SpriteFrame, function (err, spriteFrame) {
                that.node.getChildByName('voiceBtn').getComponent(cc.Sprite).spriteFrame = spriteFrame;
            });
        } else {
            var _that2 = this;
            console.log("声音开");
            cc.loader.loadRes("syssoundon2", cc.SpriteFrame, function (err, spriteFrame) {
                _that2.node.getChildByName('voiceBtn').getComponent(cc.Sprite).spriteFrame = spriteFrame;
            });
        }
    },
    start: function start() {}
}

// update (dt) {},
);

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=stopView.js.map
        